package com.xm.xmapp.adapter;

import java.util.ArrayList;
import java.util.List;

import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;

public class ViewPagerAdapter extends PagerAdapter{
	
	
	/**
	 * 用来存储pager的
	 */
	private List<View> mViews = new ArrayList<View>();
	
	
	
	
	public ViewPagerAdapter(List<View> mViews) {
		super();
		this.mViews = mViews;
	}

	public void destroyItem(View arg0, int arg1, Object arg2) {
		((ViewPager) arg0).removeView(mViews.get(arg1));
	}

	public void finishUpdate(View arg0) {

	}

	public int getCount() {

		return mViews.size();
	}

	public Object instantiateItem(View arg0, int arg1) {
		((ViewPager) arg0).addView(mViews.get(arg1));
		return mViews.get(arg1);

	}

	public boolean isViewFromObject(View arg0, Object arg1) {
		return arg0 == arg1;
	}

	public void restoreState(Parcelable arg0, ClassLoader arg1) {

	}

	public Parcelable saveState() {
		return null;
	}

	public void startUpdate(View arg0) {

	}

}
